import navToNext from '../../wxjs/navToNext.js'
const app = getApp();

let methods = {
  copyBtn,
  tapQrcode
};

var component = {
  properties: {
    matchScheduleInfo: Object,
    activeRule:{
      type: null,
      observer: function (newVal, oldVal) {
        
      }
    },
  },
  data: {
    xhx_images: app.xhx_images,
    xhx_route: app.xhx_route,
  },
  methods: Object.assign(navToNext, methods)
};

Component(component);

function copyBtn(e) {
  var that = this;
  var url = that.data.activeRule.redirectUrl;
  var challengeId = that.data.activeRule.tV2CustomMatchScheduleId;
  // console.log(that.data.activeRule);
  wx.setClipboardData({
    //去找上面的数据
    data: url+'?id=' + challengeId +'&form=1',
    success: function (res) {
      wx.showToast({
        title: '复制成功',
      });
    }
  });
}

function tapQrcode(e) {
  var that = this
  wx.previewImage({
    urls: [that.data.activeRule.serviceQrCode],
  })
}